package study.concurrent.lock.support.utils;

import cn.hutool.core.thread.ThreadUtil;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class SleepUtils {

    public static void sleep(long sec) {
        ThreadUtil.sleep(sec * 1000);
    }

    public static void sleepWaitFor(long sec) {
        int step = 1;
        while (step <= sec) {
            log.info(">>>>>> 休息第 {} 秒", step++);
            ThreadUtil.sleep(1000);
        }
    }
}
